<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<script language="javascript" src="/js/jquery-1.8.0.min.js"></script>
	<title>页面点击统计 - 票付通分销平台</title>
</head>
<body>
	<link rel="stylesheet" href="/css/aliceui.min.css"/>
	<link rel="stylesheet" href="/css/resetui.css"/>
	<link rel="stylesheet" href="/css/page.css"/>
	<link rel="stylesheet" href="/css/list.css"/>
	<div class="wrap">
		<div class="ui-box">
			<div class="ui-box-head">
				<h3 class="ui-box-head-title">页面查询</h3>
			</div>
			<div class="ui-box-container">
				<div class="ui-box-content">
					<form class="ui-form" action="<?=$_SERVER['PHP_SELF']?>" method="get">
						<fieldset>
							<div class="ui-form-item" style="padding:0 5px 20px 0px">
								页面名称
								<input class="ui-input ui-input" name="page_name" type="text" value="<?=isset($_GET['page_name'])?$_GET['page_name']:''?>">
								页面标识
								<input class="ui-input ui-input" name="page_identify" type="text" value="<?=isset($_GET['page_identify'])?$_GET['page_identify']:''?>">
								页面类型
								<select class="ui-input" name="page_type">
					                <option value="all" <?=isset($_GET['page_type'])&&$_GET['page_type']=='all'?'selected':''?>>
					                全部
					                </option>
					                <option value="0" <?=isset($_GET['page_type'])&&$_GET['page_type']=='0'?'selected':''?>>
					                平台页面
					                </option>
					                <option value="1" <?=isset($_GET['page_type'])&&$_GET['page_type']=='1'?'selected':''?>>
					                帮助文档
					                </option>
					                <option value="2" <?=isset($_GET['page_type'])&&$_GET['page_type']=='2'?'selected':''?>>
					                微信页面
					                </option>
					            </select>
								<input type="submit" class="ui-button ui-button-morange" value="确定"></div>
						</fieldset>
					</form>
				</div>
			</div>
		</div>
		<div class="ui-table-container">
			<table class="ui-table ui-table-noborder">
				<thead>
					<tr>
						<th>ID</th>
						<th>页面名称</th>
						<th>页面标识</th>
						<th>点击量</th>
						<th>类型</th>
						<th>最近一次更新</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody id="mem_list_tbd">
					<?php $type = array('平台内部','帮助文档', '微信页面');foreach($data['list'] as $item): ?>
					<tr>
						<td>
							<?=$item['id']?></td>
						<td>
							<?=$item['page_name']?></td>
						<td>
							<?=$item['page_identify']?></td>
						<td>
							<?=$item['hits']?></td>
						<td><?=$type[$item['page_type']]?></td>
						<td>
							<?=date('Y-m-d H:i:s', $item['last_hit_time'])?></td>
						<td>
							<a class="delete" data-id="<?=$item['id']?>" href="javascript:;">删除</a>
						</td>
					</tr>
					<?php endforeach; ?></tbody>
			</table>
		</div>
		<?php page($data['total'],$data['page'],$data['size']);?></div>

	<script>
	$(function() {
		$(".delete").on('click', function() {
			if (!confirm('您确定删除这条记录?')) return 

			var id = $(this).data('id')
			$.post(
				"<?=$_SERVER['PHP_SELF']?>", {id : id, action : 'delete'}
			).success(function(result) {
				window.location.reload()
			})
		})
	})
</script>
</body>
</html>